﻿<php>$meta_title = $vo['sale_no']." 订单详情";</php>
<include file="Public:header" />
<div id="main" class="main" >
    <div class="content">
  <h3 class="heading">编辑销售单 [ <a href="__URL__">返回列表</a> ] 
         <a class="btn btn-success" href="__URL__/send_message/id/{$vo.id}" target="_blank"> <i class="icon-envelope  icon-white"></i>发短信</a>
  </h3>
<div id="result" class="result none"></div>
<table cellpadding=3 cellspacing=3 >
    <form class="form-horizontal well" method='post' id="form1" action="__URL__/update/">
    <tr><td colspan="4" class="heading h4 alert alert-info">订单号：{$vo.sale_no} 
        <span class="offset1">原单号：
        <eq name="vo.status" value="0">
        {:modList('Order_source',$vo['order_source_id'],'span2','order_source_id')}
        <input class="span2" type="text" name="mall_no" value="{$vo.mall_no}" />
          <else/>
           {$vo.order_source_id|getModelName='Order_source'} | {$vo.mall_no}
        </eq> 
        </span>
        <span class="offset1">{:configList(C('orderstatus'),$vo['order_status'],'order_status')}</span>
        <span class="offset1">配货状态：{$vo.prepare_status|getConfigVal="prepare_status"}</span>
        <span class="offset1"> <eq name="vo.status" value="0"> 未审核<else/> 审核通过 </eq> </span>
       </td>
</tr>
    <tr >
        <td>购货人：</td><td>{$vo.customer_name}
            <input type="hidden" name="customer_id" value="{$vo.customer_id}" >
        </td>
        <td>下单时间：</td><td>{$vo.create_time|toDate}</td>
    </tr>
    <tr >
        <td>支付时间：</td><td>{$vo.pay_method} {$vo.pay_time|toDate}  &nbsp;&nbsp; 支付宝：{$vo.alipay}  </td>
        <td>审核时间：</td><td>{$vo.check_time|toDate}</td>
    </tr> 
           
    <tr>
        <td>应收款：</td><td>{$vo.should_pay} , 货款：{$vo.total}，客户实付款： <empty name="vo.real_pay">{$vo.sum_pay} <else/>{$vo.real_pay} </empty> </td>
        <td>快递费：</td><td>{$vo.logifee}</td>
    </tr>
    
     <tr id="more" > <td>收货人：</td><td>
        <input type="hidden" name="shipping_address_id" value="{$vo.shipping_address_id}" >
        <input type="text" name="shipping_name" value="{$vo.shipping_name}"> 
    </td>
         <td>手机</td><td> <input type="text" name="mobile" value="{$vo.mobile}"> </td>
        
    </tr>
    <!--
    <tr> <td>发票抬头：</td><td><input type="text" name="invoice_title" value="{$vo.invoice_title}"> </td>
        <td>发票内容：</td><td><input type="text" name="invoice_content" value="{$vo.invoice_content}"> </td>
    </tr> -->
    <tr id="more" >
       <td colspan="4">地址：
       省份<input class="span1" type="text" name="province" value="{$vo.province}" />
       城市<input class="span1" type="text" name="city" value="{$vo.city}" />
       区县<input class="span1" type="text" name="county" value="{$vo.county}" />
       <input type="text" class="input-xxlarge" name="address" value="{$vo.address}"> 
        电话: <input type="text" name="phone" value="{$vo.phone}"> </td>
    </tr>
    <tr>
        <td colspan="4">客户留言：<input type="text" class="span10" name="customer_msg" value="{$vo.customer_msg}"> </td>
     </tr>

<tr>
    <td colspan="4">备注: <textarea name="remark" rows="1" class="span12">{$vo.remark}</textarea> </td>
</tr>
<?php 
$mall_nos = strpos($vo['mall_no'],',') === false ? $vo['mall_no'] : explode(',', $vo['mall_no']); //分解德生堂合并订单
if(!is_array($mall_nos))
    $messages = M('Message')->where('mall_no = '.$mall_nos )->findAll(); 
else
    foreach ($mall_nos  as $mno) {
        $messages = M('Message')->where('mall_no = '.$mno )->order('create_time asc')->findAll();
        if(is_array($messages))
            break;
        else
            continue;
    }
?>

<volist name="messages" id="msg">
    <tr><td >客服备注:</td><td colspan="3"><span class="label label-important">{$msg.content}  </span> &nbsp;&nbsp;&nbsp;&nbsp; ({$msg.creater_id|getModelName='User'} {$msg.create_time|toDate}) &nbsp;&nbsp;&nbsp;&nbsp;处理状态: {:configList(C('process_status'),2,'process_status[]' )}
    <input type="hidden" name="receiver_id[]" value="{$_SESSION[C('USER_AUTH_KEY')]}" />
    <input name="msg_utime[]" type="hidden" value="{:time()}" />
    <input type="hidden" name="msg_id[]" value="{$msg.id}" />
    </td> </tr>
</volist>
<tr>
	<td>
        <eq name="vo.status" value="0"> 
           <select name="status">
                <option value="1">审核通过</option>
                <option value="0">待审核</option>
            </select>
            </eq>
    </td>
	<td class="center" width="300">
        <input type="hidden" value="{$vo.id}" name="id">
	   <button type="submit" class="btn btn-primary"><i class="icon-ok icon-white"></i> 保存</button>
	<button type="reset" onclick="javascript:history.back()" class="btn btn-info offset1"><i class="icon-arrow-left icon-white"></i> 返回</button>
	</td>
</tr>
</form>
</table>

</div>
</div>
<include file="Public:footer" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Js/easyui/themes/default/easyui.css">
<script type="text/javascript" src="__PUBLIC__/Js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Js/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Js/filter-product.js"></script>
